package 我的Java学习_算法基础.day_03;

import java.util.Arrays;

public class _059_判断数组的包含问题 {
    public static void main(String[] args) {
        String s1 ="abc",s2="2,b,h,c";
        System.out.println(containAll(s1,s2));
    }
    private static boolean containAll(String s1, String s2){
        char[] s2Array = s2.toCharArray();
        for (int i = 0; i < s1.length(); i++) {
            char t = s1.charAt(i);
            int index = Arrays.binarySearch(s2Array,t);
            if(index<0){
                return false;
            }
        }
        return true;
    }
}
